-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse app config strictly by default #3629
Conversation
In #3376 we switched `UnmarshalYAMLStrict` to `UnmarshalYAMLNonStrict`. I'm not entirely sure if this was intentional, but we want this to be strict by default. Happy to discuss if the CLI needs non-strict anywhere and if so if we can make this configurable.
The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).
|
If we did it in that PR it was definitely intentional, that PR was unfortunately massive but I would not just revert this without understanding a bit more why or why not |
Yup that's why I opened the PR to discuss if this was intentional. I have poked around a little and can't see yet why we would do this, wondering if you can recall why we did this? |
I also cannot recall why. Maybe we could add a In other internal projects, we'd like to use strict unmarshal. It's a property we'd like to maintain to avoid config issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me to have ReadConfig
be strict by default and offer a way to use non-strict.
No opinion whether it should be a separate function or a functional option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with @mfridman's thoughts on the options, stamping!
In #3376 we switched
ReadConfig
fromUnmarshalYAMLStrict
toUnmarshalYAMLNonStrict
. This was to enable a use case in an internal application. This PR switchesReadConfig
back toUnmarshalYAMLStrict
and addsReadConfigNonStrict
to enable the non-strict use case. The internal application will document why it needs the non-strict property.I verified that nothing in the CLI needs non-strict parsing, everything is using the CLI's
NameContainer
and readsbufapp.Config
.